package com.flute.icrawler.config;

import java.util.ArrayList;
import java.util.List;

import com.flute.icrawler.app.processor.AbstractProcessor;
import com.flute.icrawler.app.processor.fetch.FetchFile;
import com.flute.icrawler.app.processor.fetch.FetchHttp;
import com.flute.icrawler.app.util.XStreamUtil;

public class ProcessorConfig {

	private List<AbstractProcessor> processors = new ArrayList<AbstractProcessor>();

	public List<AbstractProcessor> getAbstractProcessors() {
		return processors;
	}

	public void setAbstractProcessors(List<AbstractProcessor> abstractProcessors) {
		this.processors = abstractProcessors;
	}

	public void addProcessor(AbstractProcessor processor) {
		processors.add(processor);
	}
	
	public static void main(String[] args) {
		ProcessorConfig configNew = new ProcessorConfig();
		FetchHttp fetchHttp = new FetchHttp();
		fetchHttp.addDependencyID(10);
		fetchHttp.addDependencyID(3);
		configNew.addProcessor(fetchHttp);
		configNew.addProcessor(new FetchFile());
		XStreamUtil.buildXMLFile(configNew, "f://2.xml");
	}
}
